package com.producerConsumer;

public class Producer implements Runnable {
	
	StackBasket ss = new StackBasket();

	Producer(StackBasket ss) {
		this.ss = ss;
	}

	/**
	 * show 生产进程.
	 */
	public void run() {
		for (int i = 0; i < 20; i++) {
			Mantou m = new Mantou(i);
			ss.push(m);
			try {
				Thread.sleep((int) (Math.random() * 500));
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}
	
}
